home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / libs / sphigs / sph_dos.lha / dos / srgp / srgppubl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-11-26  |  7.0 KB  |  195 lines

  1. #include <stdio.h>
  2.  
  3. /* the special screen canvas */
  4. #define SCREEN_CANVAS        0
  5.  
  6. #define SCREEN_WIDTH       -1
  7. #define SCREEN_HEIGHT        -2
  8.  
  9.  
  10.  
  11. /* write mode */
  12. #define WRITE_REPLACE               0
  13. #define WRITE_XOR                   2
  14. #define WRITE_OR                    1
  15. #define WRITE_AND                   7
  16.  
  17. typedef void (*funcptr)();
  18.  
  19.  
  20. /* GEOMETRIC DATA TYPES */
  21. typedef struct {int x, y;}                 srgp__point;
  22. typedef struct {srgp__point bottom_left, top_right;}    srgp__rectangle;
  23.  
  24.  
  25. typedef unsigned char boolean;
  26.  
  27. /*!*/
  28. /* ATTRIBUTE BUNDLE (application should never use internals) */
  29. typedef struct {
  30.    int write_mode;
  31.    srgp__rectangle clip_rectangle;
  32.    int font;
  33.    int line_style, line_width;
  34.    int marker_size, marker_style;
  35.    int color, background_color;
  36.    int plane_mask;
  37.    int fill_style;
  38.    int fill_pixmap_pattern_id;
  39.    int fill_bitmap_pattern_id;
  40.    int pen_style;
  41.    int pen_pixmap_pattern_id;
  42.    int pen_bitmap_pattern_id;
  43. } srgp__attribute_group;
  44.  
  45.  
  46. typedef struct {
  47.    srgp__point position;
  48.    int button_chord[3];
  49.    int button_of_last_transition;
  50. } srgp__locator_measure;
  51.  
  52. typedef struct {
  53.     int seconds;
  54.     int ticks;
  55. } srgp_timestamp;
  56.  
  57. typedef struct {
  58.    srgp__point position;
  59.    int button_chord[3];
  60.    int button_of_last_transition;
  61.     int modifier_chord[3];
  62.     srgp_timestamp timestamp;
  63. } srgp__deluxe_locator_measure;
  64.  
  65. typedef struct {
  66.     char *buffer;
  67.     int buffer_length;
  68.     int modifier_chord[3];
  69.     srgp_timestamp timestamp;
  70. } srgp__deluxe_keyboard_measure;
  71.  
  72. #ifdef SRGP_BOSS
  73. #define DECLARE
  74. #else
  75. #define DECLARE extern
  76. #endif
  77.  
  78. DECLARE int        COLOR_BLACK, COLOR_WHITE;
  79. #define SRGP_BLACK  COLOR_BLACK
  80. #define SRGP_WHITE  COLOR_WHITE
  81.  
  82. DECLARE FILE            *SRGP_logStream;
  83.  
  84. #undef DECLARE
  85.  
  86.  
  87.  
  88. /** SRGP ROUTINES THAT RETURN NON-VOID VALUES
  89. **/
  90.  
  91. srgp__point SRGP_defPoint (int x, int y);
  92. srgp__rectangle SRGP_defRectangle (int left_x, int lower_y, int right_x, int upper_y);
  93.  
  94. int SRGP_createCanvas (int width, int height);
  95.  
  96. int SRGP_waitEvent (int maximum_wait_time);
  97.  
  98. srgp__rectangle SRGP_inquireClipRectangle (void);
  99. int SRGP_inquireWriteMode (void);
  100. int SRGP_inquireFont (void);
  101. int SRGP_inquireLineStyle (void);
  102. int SRGP_inquireColor (void);
  103. int SRGP_inquireBackgroundColor (void);
  104. int SRGP_inquirePattern (void);
  105.  
  106. int SRGP_inquireActiveCanvas (void);
  107. int SRGP_inquireCanvasDepth (void);
  108. srgp__rectangle SRGP_inquireCanvasExtent (int canvas_index);
  109.  
  110.  
  111. /** SRGP ROUTINES THAT RETURN VOID VALUES
  112. **/
  113. void SRGP_begin (char *name, int width, int height, int planes, boolean please_trace);
  114. void SRGP_beep (void);
  115. void SRGP_copyPixel (int source_canvas_index, srgp__rectangle source_rect, srgp__point dest_corner);
  116. void SRGP_deleteCanvas (int canvas_index);
  117. void SRGP_ellipse (srgp__rectangle rect);
  118. void SRGP_end (void);
  119. void SRGP_fillEllipse (srgp__rectangle rect);
  120. void SRGP_fillPolygon (int vert_count, srgp__point *vertices);
  121. void SRGP_fillPolygonCoord (int vert_count, int *x_coords, int *y_coords);
  122. void SRGP_fillRectangle (srgp__rectangle rect);
  123. void SRGP_fillRectangleCoord (int left_x, int lower_y, int right_x, int upper_y);
  124. void SRGP_fillRectanglePt (srgp__point lower_left, srgp__point upper_right);
  125. void SRGP_getDeluxeKeyboard (srgp__deluxe_keyboard_measure *measure);
  126. void SRGP_getDeluxeLocator (srgp__deluxe_locator_measure *measure);
  127. void SRGP_getKeyboard (char *measure, int bufsize);
  128. void SRGP_getLocator (srgp__locator_measure *measure);
  129. void SRGP_inquireAttributes (srgp__attribute_group *group);
  130. void SRGP_inquireCanvasSize (int canvas_index, int *width, int *height);
  131. void SRGP_inquireColorTable (int index, int count, unsigned short *red, unsigned short *green, unsigned short *blue);
  132. void SRGP_inquireTextExtent (char *str, int *width, int *ascent, int *descent);
  133. void SRGP_line (srgp__point pt1, srgp__point pt2);
  134. void SRGP_lineCoord (int x1, int y1, int x2, int y2);
  135. void SRGP_loadBitmapPattern (int index, char *data);
  136. int  SRGP_loadBitmapPatternsFromFile (FILE *stream);
  137. void SRGP_loadPixmapPattern (int index, int *data);
  138. int  SRGP_loadPixmapPatternsFromFile (FILE *stream);
  139. void SRGP_loadColorTable (int startentry, int count, unsigned short *red, unsigned short *green, unsigned short *blue);
  140. void SRGP_loadCommonColor (int entry, char *colorname);
  141. void SRGP_loadCursorTable (int index, int cursor);
  142. void SRGP_loadFont (int font_index, char *filename);
  143. void SRGP_point (srgp__point pt);
  144. void SRGP_pointCoord (int x, int y);
  145. void SRGP_polygon (int vert_count, srgp__point *vertices);
  146. void SRGP_polygonCoord (int vert_count, int *x_coords, int *y_coords);
  147. void SRGP_polyLine (int vert_count, srgp__point *vertices);
  148. void SRGP_polyLineCoord (int vert_count, int *x_coords, int *y_coords);
  149. void SRGP_polyMarker (int vert_count, srgp__point *vertices);
  150. void SRGP_polyMarkerCoord (int vert_count, int *x_coords, int *y_coords);
  151. void SRGP_polyPoint (int vert_count, srgp__point *vertices);
  152. void SRGP_polyPointCoord (int vert_count, int *x_coords, int *y_coords);
  153. void SRGP_rectangle (srgp__rectangle rect);
  154. void SRGP_rectangleCoord (int left_x, int lower_y, int right_x, int upper_y);
  155. void SRGP_rectanglePt (srgp__point lower_left, srgp__point upper_right);
  156. void SRGP_refresh (void);
  157. void SRGP_sampleDeluxeKeyboard (srgp__deluxe_keyboard_measure *measure);
  158. void SRGP_sampleDeluxeLocator (srgp__deluxe_locator_measure *measure);
  159. void SRGP_sampleKeyboard (char *measure, int bufsize);
  160. void SRGP_sampleLocator (srgp__locator_measure *measure);
  161. void SRGP_setAttributes (srgp__attribute_group *group);
  162. void SRGP_setBackgroundColor (int pixelvalue);
  163. void SRGP_setClipRectangle (srgp__rectangle value);
  164. void SRGP_setColor (int pixelvalue);
  165. void SRGP_setFillBitmapPattern (int index);
  166. void SRGP_setFillPixmapPattern (int index);
  167. void SRGP_setFillStyle (int value /* SOLID, BITMAP_PATTERN_OPAQUE, BITMAP_PATTERN_TRANSPARENT, PIXMAP_PATTERN */);
  168. void SRGP_setFont (int font_index);
  169. void SRGP_setInputMode (int device /* LOCATOR, KEYBOARD */, int mode /* INACTIVE, SAMPLE, EVENT */);
  170. void SRGP_setKeyboardEchoColor (int color_index);
  171. void SRGP_setKeyboardEchoFont (int font_index);
  172. void SRGP_setKeyboardEchoOrigin (srgp__point position);
  173. void SRGP_setKeyboardProcessingMode (int value /* EDIT, RAW */);
  174. void SRGP_setKeyboardMeasure (char *value);
  175. void SRGP_setLineStyle (int value /* CONTINUOUS, DASHED */);
  176. void SRGP_setLineWidth (int width_in_pixels);
  177. void SRGP_setMarkerStyle (int style);
  178. void SRGP_setMarkerSize (int size);
  179. void SRGP_setLocatorButtonMask (int mask);
  180. void SRGP_setLocatorEchoCursorShape (int cursor_index);
  181. void SRGP_setLocatorEchoRubberAnchor (srgp__point position);
  182. void SRGP_setLocatorEchoType (int value /* NO_ECHO, CURSOR, RUBBER_LINE, RUBBER_RECT */);
  183. void SRGP_setLocatorMeasure (srgp__point value);
  184. void SRGP_setPenBitmapPattern (int index);
  185. void SRGP_setPenPixmapPattern (int index);
  186. void SRGP_setPenStyle (int value /* SOLID, BITMAP_PATTERN_OPAQUE, BITMAP_PATTERN_TRANSPARENT, PIXMAP_PATTERN */);
  187. void SRGP_setPlaneMask (int bitmask);
  188. void SRGP_setWriteMode (int value /* REPLACE, XOR, OR, AND */);
  189. void SRGP_text (srgp__point origin, char *str);
  190. void SRGP_tracing (boolean please_trace);
  191. void SRGP_useCanvas (int canvas_index);
  192.  
  193. void SRGP_forceSquarePixels (void);
  194. void SRGP_setVideoMode (int mode);
  195.